﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/MasterPage.Master" AutoEventWireup="true" CodeBehind="ListDiscussions.aspx.cs" Inherits="DrivingCRM.Views.Private.Forum.ListDiscussions" %>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="banniere" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="nav" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="contenu" runat="server">
    <h2>Liste des discussions</h2>
    <asp:Button ID="Insert_button" runat="server" Text="Ajouter une discussion" onclick="Insert_button_Click" />
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="IdDiscussion" 
        DataSourceID="DS_Discussions" GroupItemCount="1">

        <ItemTemplate>
            <table style='border:1px solid black'>
            <tr>
                    <td>Titre:</td>
                    <td><asp:LinkButton ID="IdDiscussionLabel" runat="server" CommandArgument='<%# Eval("IdDiscussion") %>' 
                    Text='<%# Eval("Title") %>' OnClick="Link_Clicked"/></td>
            </tr>
                <tr>
                    <td>Description:</td>
                    <td><i><asp:Label ID="DescriptionLabel" runat="server" 
                    Text='<%# Eval("Description") %>' /></i></td>
                </tr>
                <tr>
                    <td>Nom de l'utilisateur:</td>
                    <td><asp:Label ID="UserLabel" runat="server" Text='<%# Eval("User.Firstname") + " " + Eval("User.Lastname") %>' /></td>
                </tr>
            </table>
        </ItemTemplate>
        
    </asp:ListView>
    <asp:EntityDataSource ID="DS_Discussions" runat="server" 
        ConnectionString="name=Model_DrivingCRMContainer" 
        DefaultContainerName="Model_DrivingCRMContainer" EnableFlattening="False" 
        EntitySetName="DiscussionSet" EntityTypeFilter="Discussion" Include="User">
    </asp:EntityDataSource>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="footer" runat="server">
</asp:Content>
